//Titanium.include("/makan/model/loadTemplate.js");
friendsTap.addEventListener('click',function(e) {
	this.backgroundImage = "mainWindow.backgroundImage";
	
	searchTap.backgroundImage=null;
	placesTap.backgroundImage=null;
	profileTap.backgroundImage=null;
	
	searchTap.backgroundColor="#dd127d";
	profileTap.backgroundColor="#dd127d";
	placesTap.backgroundColor="#dd127d";

	friendsLabel.color ='#2d2d2d';
	searchLabel.color = '#fff';
	profileLabel.color = '#fff';
	placesLabel.color = '#fff';
	
	mainWindow.add(friendsContainer);
	mainWindow.remove(placesContainer);
	mainWindow.remove(profileContainer);
	mainWindow.remove(searchContainer);
	
	Titanium.include('/makan/ui/friendsView.js');
	
});

searchTap.addEventListener('click',function(e) {
	this.backgroundImage = "mainWindow.backgroundImage";
	
	friendsTap.backgroundImage=null;
	placesTap.backgroundImage=null;
	profileTap.backgroundImage=null;
	
	friendsTap.backgroundColor="#dd127d";
	profileTap.backgroundColor="#dd127d";
	placesTap.backgroundColor="#dd127d";

	friendsLabel.color = '#fff';
	profileLabel.color = '#fff';
	placesLabel.color = '#fff';
	searchLabel.color='#2d2d2d';
	
	mainWindow.add(searchContainer);
	mainWindow.remove(placesContainer);
	mainWindow.remove(profileContainer);
	mainWindow.remove(friendsContainer);
	
	Titanium.include('/makan/ui/searchView.js');
});

profileTap.addEventListener('click',function(e) {
	this.backgroundImage = "mainWindow.backgroundImage";
	
	searchTap.backgroundImage=null;
	placesTap.backgroundImage=null;
	friendsTap.backgroundImage=null;
	
	searchTap.backgroundColor="#dd127d";
	friendsTap.backgroundColor="#dd127d";
	placesTap.backgroundColor="#dd127d";
	
	profileLabel.color='#2d2d2d';
	searchLabel.color = '#fff';
	friendsLabel.color = '#fff';
	placesLabel.color = '#fff';
	
	mainWindow.add(profileContainer);
	mainWindow.remove(placesContainer);
	mainWindow.remove(friendsContainer);
	mainWindow.remove(searchContainer);
	
	Titanium.include('/makan/ui/profileView.js');

});

placesTap.addEventListener('click',function(e) {
	this.backgroundImage = "mainWindow.backgroundImage";
	
	searchTap.backgroundImage=null;
	profileTap.backgroundImage=null;
	friendsTap.backgroundImage=null;

	searchTap.backgroundColor = "#dd127d";
	profileTap.backgroundColor = "#dd127d";
	friendsTap.backgroundColor = "#dd127d";
	
	placesLabel.color='#2d2d2d';
	searchLabel.color = '#fff';
	profileLabel.color = '#fff';
	friendsLabel.color = '#fff';
	
	mainWindow.add(placesContainer);
	mainWindow.remove(friendsContainer);
	mainWindow.remove(profileContainer);
	mainWindow.remove(searchContainer);
	
	Titanium.include('/makan/ui/placesView.js');
});